package com.teamcooperation.controller;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;

@ApiModel(description = "实现用户登录")
@Controller
public class IndexController {

    /**
     * 实现HTML页面之间的跳转
     *
     * @param request
     * @return
     */
    @ApiOperation(value = "设置页面之间的访问")
    @RequestMapping(value = "/toPage", method = RequestMethod.GET)
    public String toPage(HttpServletRequest request) {
        String url = request.getParameter("url");
        return url;
    }

    @RequestMapping("/")
    public String index() {
        System.out.println("-----------");
        return "index";
    }

    @RequestMapping("main")
    public String main() {
        return "login";
    }

    @ApiImplicitParam(value = "修改密码")
    @RequestMapping("changethepassword")
    public String changethepassword() {
        return "tang/changethepassword";
    }

    @ApiImplicitParam(value = "表单")
    @RequestMapping("marketing")
    public String marketing() {
        return "tang/marketing";
    }

}
